package com.jobmanagementsystem.feign;

import com.jobmanagementsystem.common.CommonResult;
import com.jobmanagementsystem.entity.EmploymentInfo;
import java.util.List;
import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "job-management-server")
public interface ManagementServiceFeign {

  @PostMapping(value = "/employmentManagement/getEmploymentList",name = "列表")
  public CommonResult<List<EmploymentInfo>> getAllInfo(@RequestBody EmploymentInfo employmentInfo,
      @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum);

  @PostMapping(value = "/employmentManagement/getEmploymentInfo",name = "详情")
  public CommonResult<List<EmploymentInfo>> getEmploymentInfo(@RequestBody EmploymentInfo info,
      @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum);

  @PostMapping(value = "/employmentManagement/addEmploymentInfo",name = "新增")
  public CommonResult<Integer> addEmploymentInfo(@RequestBody EmploymentInfo info);

  @PostMapping(value = "/employmentManagement/updateEmploymentInfo",name = "修改")
  public CommonResult<Integer> updateEmploymentInfo(@RequestBody EmploymentInfo info);

  @PostMapping(value = "/employmentManagement/delEmployment/{infoId}",name = "删除")
  public CommonResult<Integer> delInfo(@PathVariable("infoId") String infoId);

  @PostMapping(value = "/employmentManagement/statistic/{fieldName}",name = "统计")
  public CommonResult<List<Map<String, String>>> getStatisticData(
      @PathVariable("fieldName") String fieldName,
      @RequestParam("limit") int pageSize, @RequestParam("page") int pageNum);
}
